﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using IQKS.AWP.BusinessObject;

namespace IQKS.AWP.DataAccessLayer
{
    public class PaymentInvoiceDAL
    {
        public DataSet GetPaymentInvoiceByAssessor(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetPaymentInvoiceByAssessor", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }


        public object SetPaymentInvoice(PaymentInvoiceBO param)
          {
              try
              {
              
                  SqlParameter[] parameters = new SqlParameter[]
               {
                  new SqlParameter("@SetMethod",param.SetMethod),
                  new SqlParameter("@PaymentAmount", param.PaymentAmount),
                  new SqlParameter("@PaymentDate", param.PaymentDate),
                  new SqlParameter("@PaymentComment",param.PaymentComment),
                  new SqlParameter("@AssessorPaymentID",param.AssessorPaymentID),
                  new SqlParameter("@CreatedBy",param.CreatedBy),
                  
                   new SqlParameter("@InvoiceID",param.InvoiceID),
              
              
              };
                  return DataUtils.ExecuteScalar("Usp_SetUserWiseAssessorInvoice", parameters);
              }
              catch (Exception ex)
              {
                  throw new ApplicationException(ex.Message);
              }
          }

        public DataSet GetPaymentStatusDashboardUserWise(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetPaymentStatusDashboardUserWise", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

        public DataSet GetPaymentStatusDetailUserWise(params object[] param)
        {
            DataSet objDs;

            try
            {
                objDs = DataUtils.ExecuteDataset("Usp_GetPaymentStatusDetailUserWise", param);

            }
            catch (Exception exception)
            {
                throw new ApplicationException(exception.Message);
            }
            return objDs;
        }

    }
}
